Event-driven dosing